package leets.leet2351;

import java.util.HashSet;
import java.util.Set;

public class Solution {
    public char repeatedCharacter(String s) {
        Set<Character> set=new HashSet<>();
        for (int i=0;i<s.length();i++){
            char c=s.charAt(i);
            if(set.contains(c)){
                return c;
            }else {
                set.add(c);
            }
        }
        return '0';
    }
}